1. Field of the Invention
The present invention is related to computer systems in which processor hardware facility state information is restored after context swaps, and in particular to techniques for ensuring that valid performance-monitoring hardware facility state information is used in subsequent activities.
2. Description of Related Art
In computer systems, hardware facilities in a processor can be provided for making performance measurements, tracking program execution, or other purposes. Computer system performance can be improved by monitoring the performance of the computer system or behavior of the programs. By observing characteristics of program execution, in particular, by observing characteristics of “hot spots”, i.e., portions of a program that are executed most frequently, the program can be optimized, either off-line or on-the-fly, using the result of the performance measurements.
However, when a task is off-loaded, when the present execution of a program is terminated, to be resumed at a later time and the program is unloaded from memory, the state of the performance monitoring hardware is typically lost, making it difficult to monitor performance of tasks that are executed intermittently. In some cases the performance monitoring state may not be accessible so that the state cannot be stored and retrieved when the task is off-loaded.
A particular performance monitoring technique, as disclosed in the above-incorporated parent U.S. patent Application, entitled “TASK SWITCH IMMUNIZED PERFORMANCE MONITORING”, delays performance monitoring operation, i.e., the use of the information collected by the hardware performance-monitoring facilities after a context switch occurs, to avoid using invalid performance monitoring states.